package org.zsk.cs.sendmail;

import org.zsk.cs.util.common.enums.EmailSubject;

import javax.mail.MessagingException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.io.File;

/**
 * <p>
 *     邮件 service
 * </p>
 *
 * @author zsk
 * @version 1.0
 * Created on 2020/4/19
 */
public interface MailService {

    /**
     * 发送带图片邮件
     * @param from
     * @param to
     * @param subject
     * @param content
     * @param srcPath
     * @param resIds
     */
    void sendMailWithImg(String from, String to,
                         String subject, String content,
                         String[] srcPath, String[] resIds) throws MessagingException;

    /**
     * 发送记得邮件
     * @param from
     * @param to
     * @param cc
     * @param subject
     * @param content
     */
    void sendSimpleMail(String from, String to, String cc, String subject, String content);


    /**
     * 发送带附件邮件
     * @param from
     * @param to
     * @param subject
     * @param content
     * @param file
     */
    void sendAttachFileMail(String from, String to,
                            String subject, String content, File file) throws MessagingException;

    /**
     * 发送html邮件
     * @param from
     * @param to
     * @param subject
     * @param content
     */
    void sendHtmlMail(String from, String to,
                      String subject, String content) throws MessagingException;

    /**
     * 用户绑定邮箱
     * @param email 邮箱
     * @param emailVerifyCode 激活验证码
     * @return 绑定结果
     */
    boolean bind(String email, String emailVerifyCode) throws MessagingException;

    /**
     * 激活用户邮箱
     * @param emailVerifyCode 激活验证码
     * @return 激活结果
     */
    boolean active(String emailVerifyCode);

    /**
     * 用户解绑邮箱
     * @param emailVerifyCode 激活验证码
     * @return
     */
    boolean unBind(String emailVerifyCode);

    /**
     * 获取激活邮箱验证码
     * @return
     * @throws MessagingException
     */
    boolean sendEmailVerifyCode(EmailSubject emailSubject,String email) throws MessagingException;
}
